<?php
/**
Exibe as informa��es que foram inseridas no formul�rio de cadastro de Reserva
Ap�s confirmada, as informa��es ser�o inseridas no banco de dados.
*/

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}


// dados do formulário vindos de CadastrarRateio.php
$anoId 		    = $_POST['anoId'];
$programaId     = $_POST['programaId'];
$campusId    	= $_POST['campiId'];
$tipoDespesa    = $_POST['tipoDespesa'];
$fonteId 	    = $_POST['fonteId'];
$valorReserva   = $_POST['valorReserva']; 
$setorId 		= $_POST['setorId'];
$processo		= $_POST['processoReserva'];
$despesa		= $_POST['despesaReserva'];
$natureza		= $_POST['naturezaDespesa'];
$subElementoId    = $_POST['subelemReserva'];
$licitacaoId	= $_POST['licitacaoId'];
$planoInternoId = $_POST['planoInternoId'];

if(isset($_POST['idProcesso'])){
	$idProcesso   = $_POST['idProcesso'];	
}


$ano = new Ano();
$anoSelecionado = $ano->CarregarAno( $anoId );

$programa = new Programa();
$programaSelecionado = $programa->CarregarPrograma( $programaId );

$campi = new Campus();
$campiSelecionado = $campi->CarregarCampus( $campusId );

$fonte = new Fonte();
$fonteSelecionada = $fonte->CarregarFonte( $fonteId );

$setor = new Setor();
$setorSelecionado = $setor->CarregarSetor( $setorId );

$licitacao = new Licitacao();
$licitacaoSelicionada = $licitacao->CarregarLicitacao($licitacaoId);

$naturezaDespesa = new NaturezaDespesa();
$naturezaDespesaSelect = $naturezaDespesa->CarregarNaturezaDespesa($natureza);

$subElemento = new SubElemento();
$subElementoSelect = $subElemento->CarregarSubElemento($natureza, $subElementoId);



?>
<html>
           <head>
           <title>SAEO - Confirmar Reserva de Recurso </title>
           <link rel='stylesheet' type='text/css' href='templates/estilos.css'>
           </head>
     		<body class='body' ">
     		<form name='confirmar_reserva' action='EnviarDadosReserva.php?operacao=1' method='post'>
     		<table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
            <tr>
				<td><?php include "Topo.php"; ?> </td>
			</tr>
            <tr>
                <td><div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>CONFIRMAR RESERVA DE RECURSO</div></td>
            </tr>
            <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
            <tr>
                <td><table class='tabela' width='650' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
                           <tr>
                               <td>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas' width='30%'>&nbsp;Ano:</td>
                               <td class='textoTabelas'><?php echo $anoSelecionado->ano ?></td>
                               <input type='hidden' name='anoId' value='<?php echo $anoId ?>'>
                           </tr>
                           <tr>
                               <td>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas' width='35%'>&nbsp;A&ccedil;&atilde;o Or&ccedil;ament&aacute;ria:</td>
                               <td class='textoTabelas'><?php echo $programaSelecionado->nome; ?></td>
                               <input type='hidden' name='programaId' value='<?php echo $programaId ?>'>
                           </tr>
                           <tr>
                               <td>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas' width='30%'>&nbsp;Tipo de Despesa:</td>
                               <td class='textoTabelas'><?php echo ($tipoDespesa == 33)?"33 - Corrente" : "44 - Capital" ?></td>
                               <input type='hidden' name='tipoDespesa' value='<?php echo $tipoDespesa ?>'>
                           </tr>                           
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Fonte de Recurso:</td>
                               <td class='textoTabelas'><?php echo $fonteSelecionada->fonteRecurso; ?></td>
                               <input type='hidden' name='fonteId' value='<?php echo $fonteSelecionada->id; ?>'>
                               <input type='hidden' name='planoInternoId' value='<?php echo $planoInternoId; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Unidade:</td>
                               <td class='textoTabelas'><?php echo $campiSelecionado->nome; ?></td>
                               <input type='hidden' name='campiId' value='<?php echo $campiSelecionado->id; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Setor:</td>
                               <td class='textoTabelas'><?php echo $setorSelecionado->nome; ?></td>
                               <input type='hidden' name='setorId' value='<?php echo $setorSelecionado->id; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Processo:</td>
                               <td class='textoTabelas'><?php echo $processo; ?></td>
                               <input type='hidden' name='processoReserva' value='<?php echo $processo; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Modalidade Licitacao:</td>
                               <td class='textoTabelas'><?php echo $licitacaoSelicionada->modalidade; ?></td>
                               <input type='hidden' name='licitacaoId' value='<?php echo $licitacaoId; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Despesa:</td>
                               <td class='textoTabelas'><?php echo $despesa; ?></td>
                               <input type='hidden' name='despesaReserva' value='<?php echo $despesa; ?>' />
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Natureza de Depesa:</td>
                               <td class='textoTabelas'><?php echo "$naturezaDespesaSelect->id - $naturezaDespesaSelect->descricao;" ?> 
                               </td>
                               <input type='hidden' name='naturezaReserva' value='<?php echo $naturezaDespesaSelect->id; ?>'>
                               
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Subelemento:</td>
                               <td class='textoTabelas'><?php echo "$subElementoSelect->subElementoId - $subElementoSelect->descricao"; ?> 
                               </td>
                               <input type='hidden' name='subelemReserva' value='<?php echo $subElementoSelect->subElementoId; ?>'>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>                                                      
                           <tr>
                               <td class='textoTabelas'>&nbsp;Valor da Reserva:</td>                               
                               <td class='textoTabelas'>R$&nbsp;<?php echo $valorReserva ?></td>
                               <input type='hidden' name='valorReserva' value='<?php echo $valorReserva;?>'>
                           </tr>                           
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>                           
                           <tr>
                               <td colspan='2' height='46'><div style='position:relative;left:220px'><img style='width:100px;height:30px;cursor:pointer;' src='templates/btvoltar.JPG' onclick='javascript: history.go(-1);'>&nbsp
                               <input type='image' style='width:100px;height:30px;' src='templates/btavancar.JPG'/></div></td>
                           <tr>
                     </table>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tfoot>
           <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
                   <tr><?php include 'rodapeCreditos.php'; ?></tr>
            </tfoot>
     </table>
     </form>
     </body>
     </html>